#pragma once

#include "IXIconDraw.h"
#include "Logic/Include/XBaseObjImpl.h"


class CXIconDrawImpl : public CXBaseObjImpl<IXIconDraw>
{
    typedef CXBaseObjImpl<IXIconDraw> superclass;

    BEGIN_DEF_SKIN_CLASS(CXIconDrawImpl, superclass, gs_strGuidXSkin)
        IMP_BASIC_INTF(IXIconDraw, 0)
        IMP_BASIC_INTF(IXDraw, eIntf_NoCreate)
    END_DEF_SKIN_CLASS();
public:
    CXIconDrawImpl();
    virtual ~CXIconDrawImpl();

public:
    // IXIconDraw
    virtual HRESULT STDMETHODCALLTYPE   put_IconPath(IN LPCTSTR szXNC, IN BOOL bBigIcon);

    virtual HRESULT STDMETHODCALLTYPE   get_IconSize(OUT LPSIZE lpSize);

    virtual BOOL    STDMETHODCALLTYPE   IsDrawValid();

    // IXDraw
    virtual HRESULT STDMETHODCALLTYPE   Draw(IN XCANVAS xCanvas, const RECT* lpDes);
    virtual HRESULT STDMETHODCALLTYPE   Draw(IN XCANVAS xCanvas, IN const RECT* lpSrc, IN const RECT* lpDes);

    virtual void    STDMETHODCALLTYPE   EnableColorize(IN BOOL bEnable);
    virtual void    STDMETHODCALLTYPE   Colorize(IN int hue, IN int sat, IN int light);

    // IBaseObj
    virtual void    STDMETHODCALLTYPE   OnFinalRelease();

protected:
    // CXIconDrawImpl
    void    ReleaseData();

protected:
    // CXIconDrawImpl
    XString     m_strXNC;
    XICON       m_xIcon;

    SIZE        m_Size;
};


